package com.ruoyi.finance.collection.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.finance.collection.domain.VBillCollection;
import com.ruoyi.finance.collection.mapper.VBillCollectionMapper;
import com.ruoyi.finance.collection.service.VBillCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 80661
* @description 针对表【V_BILL_COLLECTION】的数据库操作Service实现
* @createDate 2023-07-04 14:03:44
*/
@Service
public class VBillCollectionServiceImpl extends ServiceImpl<VBillCollectionMapper, VBillCollection>
    implements VBillCollectionService {
	
	@Override
	public List<VBillCollection> listByParams(VBillCollection vBillCollection) {
		
		// 1.创建QueryWrapper
		QueryWrapper<VBillCollection> queryWrapper = new QueryWrapper<>();
		
		// 2.构造查询条件
		
		
		
		// 3.执行查询
		List<VBillCollection> vBillCollectionList = this.list(queryWrapper);
		
		
		// 4.返回结果
		return vBillCollectionList;
		
	}
	
	@Override
	public List<VBillCollection> listVBillCollectionByProjectIds(List<String> projectIds) {
		// 1.创建QueryWrapper
		QueryWrapper<VBillCollection> queryWrapper = new QueryWrapper<>();
		
		// 2.构造查询条件
		queryWrapper.in("project_id", projectIds);
		// 根据生成时间排序
		queryWrapper.orderByDesc("CREATE_TIME");
		
		// 3.执行查询
		List<VBillCollection> vBillCollectionList = this.list(queryWrapper);
		
		// 4.返回结果
		return vBillCollectionList;
	}

	@Override
	public Long getConIdByStatementId(Long statementId) {
		return baseMapper.getConIdByStatementId(statementId);
	}
}




